﻿using System;
using System.Collections.Generic;
using SharpSqlAnalyzer.nodes;
using SharpSqlAnalyzer.nodes.hive;

namespace SharpSqlAnalyzer.stmt.hive
{
	// Token: 0x020001C5 RID: 453
	public class THiveRevoke : TCustomSqlStatement
	{
		// Token: 0x06000F1D RID: 3869 RVA: 0x0030B158 File Offset: 0x00309358
		public THiveRevoke(EDbVendor dbvendor) : base(dbvendor)
		{
			this.sqlstatementtype = ESqlStatementType.ssthiveRevoke;
		}

		// Token: 0x170002CA RID: 714
		// (get) Token: 0x06000F1E RID: 3870 RVA: 0x0030B16C File Offset: 0x0030936C
		// (set) Token: 0x06000F1F RID: 3871 RVA: 0x0030B174 File Offset: 0x00309374
		public virtual List<THivePrincipalName> Principals
		{
			get
			{
				return this.principals;
			}
			set
			{
				this.principals = value;
			}
		}

		// Token: 0x170002CB RID: 715
		// (get) Token: 0x06000F20 RID: 3872 RVA: 0x0030B17D File Offset: 0x0030937D
		// (set) Token: 0x06000F21 RID: 3873 RVA: 0x0030B185 File Offset: 0x00309385
		public virtual List<THivePrivilegeDef> PrivilegeList
		{
			get
			{
				return this.privilegeList;
			}
			set
			{
				this.privilegeList = value;
			}
		}

		// Token: 0x170002CC RID: 716
		// (get) Token: 0x06000F22 RID: 3874 RVA: 0x0030B18E File Offset: 0x0030938E
		// (set) Token: 0x06000F23 RID: 3875 RVA: 0x0030B196 File Offset: 0x00309396
		public virtual TTable Table
		{
			get
			{
				return this.table;
			}
			set
			{
				this.table = value;
			}
		}

		// Token: 0x170002CD RID: 717
		// (get) Token: 0x06000F24 RID: 3876 RVA: 0x0030B19F File Offset: 0x0030939F
		public virtual TSourceToken TableToken
		{
			get
			{
				return this.tableToken;
			}
		}

		// Token: 0x06000F25 RID: 3877 RVA: 0x0030B1A8 File Offset: 0x003093A8
		public override int doParseStatement(TCustomSqlStatement psql)
		{
			if (this.rootNode == null)
			{
				return -1;
			}
			base.doParseStatement(psql);
			THiveGrantSqlNode thiveGrantSqlNode = (THiveGrantSqlNode)this.rootNode;
			this.table = this.analyzeFromTable(thiveGrantSqlNode.FromTable, new bool?(true));
			this.principals = thiveGrantSqlNode.Principals;
			this.privilegeList = thiveGrantSqlNode.PrivilegeList;
			this.tableToken = thiveGrantSqlNode.TableToken;
			return 0;
		}

		// Token: 0x06000F26 RID: 3878 RVA: 0x0030B210 File Offset: 0x00309410
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x06000F27 RID: 3879 RVA: 0x0030B220 File Offset: 0x00309420
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			if (this.principals != null)
			{
				foreach (THivePrincipalName thivePrincipalName in this.principals)
				{
					thivePrincipalName.acceptChildren(v);
				}
			}
			if (this.privilegeList != null)
			{
				foreach (THivePrivilegeDef thivePrivilegeDef in this.privilegeList)
				{
					thivePrivilegeDef.acceptChildren(v);
				}
			}
			v.postVisit(this);
		}

		// Token: 0x0400135C RID: 4956
		private List<THivePrincipalName> principals;

		// Token: 0x0400135D RID: 4957
		private List<THivePrivilegeDef> privilegeList;

		// Token: 0x0400135E RID: 4958
		private TTable table;

		// Token: 0x0400135F RID: 4959
		private TSourceToken tableToken;
	}
}
